package com.hdd.biz.member.controller;

import com.hdd.biz.member.dto.APPMemberLoginRequest;
import com.hdd.biz.member.dto.APPMemberRequest;
import com.hdd.biz.member.dto.MemberListRequest;
import com.hdd.biz.member.service.APPMemberService;
import com.hdd.dto.SuperResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping("/app/member")
@Api(value = "(前端)会员模块",tags = {"(前端)会员模块"})
@CrossOrigin(origins = "*",maxAge = 3600)
public class APPMemberController {

    @Autowired
    private APPMemberService appMemberService;


    @PostMapping("/loginForWx")
    @ApiOperation(value = "登录" ,notes = "")
    public SuperResponse loginForWx(@Valid @RequestBody APPMemberLoginRequest request ){
        return appMemberService.weixinLogin(request);
    }


    @PostMapping("/findUserById")
    @ApiOperation(value = "根据用户ID取出信息" ,notes = "")
    public SuperResponse findUserById(@Valid @RequestBody APPMemberRequest request ){
        return appMemberService.findUserById(request);
    }



}
